package com.lanou.service;

import com.lanou.bean.Account;
import com.lanou.mapper.ServiceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by lanouhn on 17/10/24.
 */
@Service
public class ServiceServiceImpl implements ServiceService {
    @Autowired
    private ServiceMapper serviceMapper;

    @Override
    public List<com.lanou.bean.Service> selectAllService() {
        return serviceMapper.selectAllService();
    }

    @Override
    public Integer selectAccountIdByIdcard(String idcardNo) {
        return serviceMapper.selectAccountIdByIdcard(idcardNo);
    }

    @Override
    public List<String> selectAllCostName() {
        return serviceMapper.selectAllCostName();
    }

    @Override
    public Integer selectCostIdByName(String name) {
        return serviceMapper.selectCostIdByName(name);
    }

    @Override
    public int insertService(com.lanou.bean.Service service, Integer account_id, Integer cost_id) {
        return serviceMapper.insertService(service, account_id, cost_id);
    }

    @Override
    public com.lanou.bean.Service selectServiceById(Integer service_id) {
        return serviceMapper.selectServiceById(service_id);
    }

    @Override
    public int updateServiceById(Integer service_id, String unix_host, String os_username) {
        return serviceMapper.updateServiceById(service_id, unix_host, os_username);
    }


    @Override
    public int updateService(Integer service_id, Date close_date) {
        return serviceMapper.updateService(service_id, close_date);
    }

    @Override
    public int updateServiceStatus(Integer service_id, Date pause_date) {
        return serviceMapper.updateServiceStatus(service_id, pause_date);
    }

    @Override
    public int updateServiceStatus1(Integer service_id) {
        return serviceMapper.updateServiceStatus1(service_id);
    }
}

